//
//  MainTableViewCell.swift
//  CJXSwiftStoryboard
//
//  Created by CJX on 2016/10/20.
//  Copyright © 2016年 caijianxi. All rights reserved.
//

import UIKit
import SDWebImage

class MainTableViewCell: UITableViewCell {

    var myImgView = UIImageView()
    
    
    var model : MainDataModel?{
    
        didSet{
            
            self.myImgView.sd_setImage(with: URL(string: (model?.imageUrlStr)!))
        }
    
    }
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: .default, reuseIdentifier: nil)
        
        myImgView.frame = CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT*0.3)
        self.addSubview(myImgView)
        
        let label = UILabel()
        label.frame = CGRect(x: SCREEN_WIDTH*0.1, y: SCREEN_HEIGHT*0.31, width: SCREEN_WIDTH*0.8, height: SCREEN_HEIGHT*0.08)
        label.layer.borderWidth = 2
        label.text = "View Editorial"
        label.textAlignment = .center
        label.layer.borderColor = UIColor.black.cgColor
        self.addSubview(label)
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
